package cn.xawl.gulimall.auth.vo;

import lombok.Data;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.Pattern;

/**
 * @author lh
 * @create 2020-10-30 21:44
 **/
@Data
public class UserInfoVo {

    @NotEmpty(message = "用户名必须填写")
    @Length(min = 6, max = 20, message = "长度只能在6-20个字符之间")
    private String username;

    @NotEmpty(message = "密码必须填写")
    @Length(min = 6, max = 20, message = "长度只能在6-20个字符之间")
    private String password;

    @NotEmpty(message = "请填写电话号")
    @Pattern(regexp = "[1][3-9][0-9]{9}", message = "电话号格式不正确")
    private String telephone;

    //短信验证码
    @NotEmpty(message = "请填写短信验证码")
    @Pattern(regexp = "[0-9]{6}", message = "验证码为6为数字")
    private String code;

}
